package com.xxh.springclouddemo.openfeignapi.controller;

import com.xxh.springclouddemo.common.pojo.Student;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.ArrayList;
import java.util.List;

/**
 * @Author xxh
 * @Date 2024/4/14 15:24
 */
@RequestMapping("/openFeign")
@RestController
public class OpenfeignApi {

    @Value("${server.port}")
    private String port;

    @RequestMapping("/getStudent")
    public List<Student> getStudent(){


        List<Student> studentList = new ArrayList<>();

        for (int i = 0; i < 5; i++) {
            Student student = new Student();
            student.setAge(i);
            student.setName("端口号"+port+"             名字"+i);
            studentList.add(student);
        }

        return studentList;



    }


}
